package es

import (
	"github.com/elastic/go-elasticsearch/v7"
	"github.com/zeromicro/go-zero/core/logx"
)

var Elastic *elasticsearch.Client

func Init() {
	var err error
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://14.103.143.155:9200",
		},
		// ...
	}
	Elastic, err = elasticsearch.NewClient(cfg)

	if err != nil {
		panic(err)
	}
	logx.Info("Es Success")

}
